HOW I ADD

 

I'll explain how your data is added and what format it is like.

If you have read the commands section, you will have seen that the command /hadd is what you use to add items and data to table

Now for a test, In your mirc type the following in order

1) /hmake -s testing

2) /hadd -s testing nicks nick1 nick2 nick3

On your active window, you should see the same as below

* Made hash table 'testing' (100)
* Added item 'nicks' to hash table 'testing'

As you can see, you made the hash table testing and added to the main item name "nicks" to it. Now you don't see the nick1 nick2 nick3 part but is in the hash table. To see the full information type the folowing

//echo -a $hget(testing,1).item $hget(testing,1).data

In your active window, you should now see the same as below

nicks nick1 nick2 nick3

Now I'll explain what you typed. The command $hget is what you use to retreive information stored.

$hget(testing,1).item . This returns the main item name for line 1 in the hash table named testing.

$hget(testing,1).data . This returns the data associated with the item name on line 1 in the hash table.

As you will see item can only ever be one word and have no spaces, where the data can be added in way you wish and does have a large scale of data that can be adding in there. If i remember correctly in a test i did awhile ago. I managed to fit roughly about 17 full paths and filenames in one line. You will see that should be more than enough room for you to work with.

Now when you returning information, you don't need to add .item or .data onto the end of the $hget. You can just use the following

$hget(testing,nicks)

The above will return the data associated with nicks

Well just decided to split this up into two sections. so click on the link to the left, How i use hash tables to see what i do with them.